<template>
    <div class="block_main blue-tit">
        <!-- <div class="nytit">首页&gt;通知/督办</div> -->
        <el-row style="padding-top: 10px">
            <el-col :span="24" style="padding:0 5px">
                <el-card>
                    <!-- 筛选 -->
                    <el-form
                        style="padding:20px 20px 0"
                        :inline="true"
                        :model="region"
                        class="demo-form-inline"
                    >
                        <el-form-item label="时间">
                            <el-date-picker
                                v-model="region.startTime"
                                value-format="yyyy-MM-dd"
                                type="date"
                                placeholder="开始日期"
                            ></el-date-picker>
                            <el-date-picker
                                v-model="region.endTime"
                                value-format="yyyy-MM-dd"
                                type="date"
                                placeholder="结束日期"
                            ></el-date-picker>
                        </el-form-item>
                        <el-form-item label="部门">
                            <el-select v-model="region.target" placeholder="选择部门分类">
                                <el-option
                                    v-for="(list,index) in targetArr"
                                    :label="list.name"
                                    :value="list.name"
                                    :key="index"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="状态">
                            <el-select v-model="region.listStatus" placeholder="状态">
                                <el-option label="全部" value="-1"></el-option>
                                <el-option label="已完成" value="1"></el-option>
                                <el-option label="已出方案" value="2"></el-option>
                                <el-option label="正在进行" value="3"></el-option>
                                <el-option label="已超时" value="4"></el-option>
                            </el-select>
                            <el-button type="primary">查询</el-button>
                            <el-button type="success">新增事件</el-button>
                        </el-form-item>
                    </el-form>
                    <office-list :tableData="tableData" :isShow="isShow"></office-list>
                    <div class="zpage">
                        <el-pagination
                         
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page.sync="currentPage"
                            :page-size.sync="pagesize"
                            layout="total, prev, pager, next, jumper"
                            :total.sync="pagetotal"
                        ></el-pagination>
                    </div>
                </el-card>
            </el-col>
        </el-row>
    </div>
</template>
<script>
import actionurl from "@/assets/js/actionurl";
import officeList from "@/components/manageOffice/List";

export default {
    components: {
        officeList
    },
    data() {
        return {
            dialogVisible: false,
            isShow: false,
            tableData: [],
            region: {
                startTime: "",
                endTime: "",
                target: "",
                listStatus: "-1"
            },
            layerForm: {},
            targetArr: [],
            target: "",
            status: "",
            currentPage: 1,
            pagesize: 10,
            pagetotal: 10000,
            moveTarget: "",
            movegname: "",
            loading: false,
            MessageGroupArr: ""
        };
    },
    methods: {
        MessageList() {
            // 获取列表
            var _this = this;
            actionurl.MessageList(
                {
                    pageNum: _this.pagesize,
                    pageOn: _this.currentPage,
                    status: _this.region.listStatus,
                    start: _this.region.startTime,
                    end: _this.region.endTime,
                    target: _this.region.target
                },
                function(re) {
                    if (re.status == 1) {
                        // _this.tableData = re.data;
                        _this.pagetotal = re.count;

                        _this.loading = false;
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            // this.currentPage == val;
            console.log(this.currentPage);
            this.MessageList();
        },
        targetListFn() {
            var _this = this;
            actionurl.targetList({}, function(re) {
                if (re.status == 1) {
                    _this.targetArr = re.data;
                } else {
                    _this.$message(re.msg);
                }
            });
        },
        questionClass() {
            var _this = this;
            actionurl.MessageGroup(
                {
                    mesgroup: 1, //0-面对面等分类 1-八大类
                    fid: 1
                },
                function(re) {
                    console.log(re);
                    if (re.status == 1) {
                        _this.MessageGroupArr = re.data;
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },

        Accept(id) {
            console.log("id:  " + id);
        }
    },
    mounted() {
        this.MessageList();
        this.targetListFn();
    },
    created() {}
};
</script>
<style scoped lang="scss">
</style>
